home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / graphics / tiff / tools / rasterfile.h < prev    next >
C/C++ Source or Header  |  1990-10-08  |  2KB  |  42 lines

  1. /* $Header: /usr/people/sam/tiff/tools/RCS/rasterfile.h,v 1.1 90/10/08 17:24:23 sam Exp $ */
  2.  
  3. /*
  4.  * Description of header for files containing raster images
  5.  */
  6. struct rasterfile {
  7.     int    ras_magic;        /* magic number */
  8.     int    ras_width;        /* width (pixels) of image */
  9.     int    ras_height;        /* height (pixels) of image */
  10.     int    ras_depth;        /* depth (1, 8, or 24 bits) of pixel */
  11.     int    ras_length;        /* length (bytes) of image */
  12.     int    ras_type;        /* type of file; see RT_* below */
  13.     int    ras_maptype;        /* type of colormap; see RMT_* below */
  14.     int    ras_maplength;        /* length (bytes) of following map */
  15.     /* color map follows for ras_maplength bytes, followed by image */
  16. };
  17. #define    RAS_MAGIC    0x59a66a95
  18.  
  19.     /* Sun supported ras_type's */
  20. #define RT_OLD        0    /* Raw pixrect image in 68000 byte order */
  21. #define RT_STANDARD    1    /* Raw pixrect image in 68000 byte order */
  22. #define RT_BYTE_ENCODED    2    /* Run-length compression of bytes */
  23. #define RT_EXPERIMENTAL 0xffff    /* Reserved for testing */
  24.  
  25.     /* Sun registered ras_maptype's */
  26. #define RMT_RAW        2
  27.     /* Sun supported ras_maptype's */
  28. #define RMT_NONE    0    /* ras_maplength is expected to be 0 */
  29. #define RMT_EQUAL_RGB    1    /* red[ras_maplength/3],green[],blue[] */
  30.  
  31. /*
  32.  * NOTES:
  33.  *     Each line of the image is rounded out to a multiple of 16 bits.
  34.  *   This corresponds to the rounding convention used by the memory pixrect
  35.  *   package (/usr/include/pixrect/memvar.h) of the SunWindows system.
  36.  *    The ras_encoding field (always set to 0 by Sun's supported software)
  37.  *   was renamed to ras_length in release 2.0.  As a result, rasterfiles
  38.  *   of type 0 generated by the old software claim to have 0 length; for
  39.  *   compatibility, code reading rasterfiles must be prepared to compute the
  40.  *   true length from the width, height, and depth fields.
  41.  */
  42.